package com.donglan.pethome.organization.service.impl;

import com.donglan.pethome.basic.service.impl.BaseServiceImpl;
import com.donglan.pethome.organization.domain.Employee;
import com.donglan.pethome.organization.mapper.EmployeeMapper;
import com.donglan.pethome.organization.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: zhangdonghui
 * @Date: 2022/1/7 14:37
 */
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;


    @Override
    @Transactional
    public void addorUpdate(Employee employee) {
        if(employee.getId() == null){
            this.add(employee);
        }else{
            this.update(employee);
        }
    }
}
